import { ObjCreate } from "../../common/ObjCreate";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { ImagesConst } from "../../../resource/ImagesConst";
import { StatueUserPlayer } from "../../../scene/player/entity/StatueUserPlayer";
import { Language } from "../../../../../extend/language/Language";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { SLookupPlayerReply } from "../../../../../Message/Game/SLookupPlayerReply";
import { EntityUtil } from "../../../scene/layer/utils/EntityUtil";
import { DisplayUtil } from "../../../../common/DisplayUtil";
import { DirectionType } from "../../../scene/modle/data/DirectionType";
import { UserEquipmentUtil } from "../../range/userEquip/UserEquipmentUtil";
import { EDressPos } from "../../../../../Message/Public/EDressPos";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { GImageBitmap } from "../../../../../com/mui/controls/GImageBitmap";
type int = number;
//class RobCityStepZeroOwnerPanel
    
    export  class RobCityStepZeroOwnerPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._chengzhuchongbai = ObjCreate.createGTextField("", 0, 5, 200, 20, this, new GTextFormat(FontUtil.songtiName, 12, 16776960, null, null, null, null, null, flash.text.TextFormatAlign.CENTER), false);
            var loc1=ObjCreate.createGImageBitmap(ImagesConst.RobCityRoleBg, 25, 30, this);
            this._noOwner = ObjCreate.createGImageBitmap(ImagesConst.PlayerAdoreNonOwner, loc1.x + 10, loc1.y + 10, this);
            this._noOwner.visible = true;
            this._player = new StatueUserPlayer();
            this._player.x = 100;
            this._player.y = 225;
            this._player.stop();
            ObjCreate.createGTextField(Language.getString(60936), 5, 255, 190, 60, this, GlobalStyle.textFormat6, false);
            var loc2=ObjCreate.createGButton(Language.getString(60937), 135, 287, 70, 26, this, "LinkButton");
            loc2.addEventListener(flash.events.MouseEvent.CLICK, this.onLinkBtnClick);
            return;
        }

        /* internal  */onLinkBtnClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            return;
        }

        public updateStatus(): void
        {
            this._chengzhuchongbai.htmlText = HTMLUtil.addColor(Language.getStringByParam(60935, 0), "#FFFF00");
            return;
        }

        public updateWorshipDummyNum(arg1: int): void
        {
            this._chengzhuchongbai.htmlText = HTMLUtil.addColor(Language.getStringByParam(60935, arg1), "#FFFF00");
            return;
        }

        public updateSTChatelainInfo(arg1: SLookupPlayerReply): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            if (EntityUtil.isNullEntity(arg1.miniPlayer.entityId)) 
            {
                this._player.dispose();
                DisplayUtil.removeMe(this._player);
                this._noOwner.visible = true;
            }
            else 
            {
                this._player.direction = DirectionType.South;
                this._player.camp = arg1.miniPlayer.camp;
                this._player.sex = arg1.miniPlayer.sex;
                this._player.career = arg1.miniPlayer.career;
                this._player.entityInfo.entityInfo.wuxingType = arg1.wuxingFightAttribute.wuxin;
                loc1 = UserEquipmentUtil.getEquipmentData(arg1.playerItemUpdates);
                loc2 = loc1.splice((EDressPos._EDressPosRing1 - 1), 2);
                loc1.splice((EDressPos._EDressPosWristlet - 1), 0, loc2[0], loc2[1]);
                loc3 = UserEquipmentUtil.getUserEquipmentData(loc1, arg1.fashionState, arg1.wingState, arg1.fashionWeaponState, arg1.surroundState, arg1.waistBeltState, arg1.elfState);
                this._player.reserveJs.weaponStPerLv = loc3.weaponStPerLv;
                this._player.reserveJs.wingStrPerLv = loc3.wingStLv;
                this._player.updateEquipByDic(loc3.equipDic);
                this._player.updateName(arg1.miniPlayer.name);
                this._player.wxPlayerShow();
                this._player.play();
                if (!this._player.parent) 
                {
                    this.addChild(this._player);
                }
                this._noOwner.visible = false;
            }
            return;
        }

        /* internal */ /* var */_chengzhuchongbai: GTextFiled;

        /* internal */ /* var */_noOwner: GImageBitmap;

        /* internal */ /* var */_player: StatueUserPlayer;
    }
